package com.example.feignconsumer.service.fallback;

import com.example.commons.Book;
import com.example.feignconsumer.service.HelloService;
import org.springframework.stereotype.Component;

/**
 * 服务降级处理：provider访问异常时的回调
 */
@Component
public class HelloServiceFallback implements HelloService {
    @Override
    public String hello() {
        return "hello error";
    }

    @Override
    public String hello(String name) {
        return "error " + name;
    }

    @Override
    public Book hello(String name, String author, Integer price) {
        Book book = new Book();
        book.setName("error");
        return book;
    }

    @Override
    public String hello(Book book) {
        return "error book";
    }

    @Override
    public String foo(String name) {
        return "foo error";
    }

}
